package com.haixiaoke.saas.contract.service.impl;

import java.util.List;

import com.haixiaoke.saas.common.utils.DateUtils;
import com.haixiaoke.saas.contract.domain.ContractFacilitiesItem;
import com.haixiaoke.saas.contract.mapper.ContractFacilitiesItemMapper;
import com.haixiaoke.saas.contract.service.IContractFacilitiesItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 租客合同房屋设施价格Service业务层处理
 * 
 * @author panda
 * @date 2024-06-20
 */
@Service
public class ContractFacilitiesItemServiceImpl implements IContractFacilitiesItemService {
    @Autowired
    private ContractFacilitiesItemMapper contractFacilitiesItemMapper;

    /**
     * 查询租客合同房屋设施价格
     * 
     * @param facilitiesItemId 租客合同房屋设施价格主键
     * @return 租客合同房屋设施价格
     */
    @Override
    public ContractFacilitiesItem selectContractFacilitiesItemByFacilitiesItemId(Long facilitiesItemId) {
        return contractFacilitiesItemMapper.selectContractFacilitiesItemByFacilitiesItemId(facilitiesItemId);
    }

    /**
     * 查询租客合同房屋设施价格列表
     * 
     * @param contractFacilitiesItem 租客合同房屋设施价格
     * @return 租客合同房屋设施价格
     */
    @Override
    public List<ContractFacilitiesItem> selectContractFacilitiesItemList(ContractFacilitiesItem contractFacilitiesItem) {
        return contractFacilitiesItemMapper.selectContractFacilitiesItemList(contractFacilitiesItem);
    }

    /**
     * 新增租客合同房屋设施价格
     * 
     * @param contractFacilitiesItem 租客合同房屋设施价格
     * @return 结果
     */
    @Override
    public int insertContractFacilitiesItem(ContractFacilitiesItem contractFacilitiesItem) {
        contractFacilitiesItem.setCreateTime(DateUtils.getNowDate());
        return contractFacilitiesItemMapper.insertContractFacilitiesItem(contractFacilitiesItem);
    }

    /**
     * 修改租客合同房屋设施价格
     * 
     * @param contractFacilitiesItem 租客合同房屋设施价格
     * @return 结果
     */
    @Override
    public int updateContractFacilitiesItem(ContractFacilitiesItem contractFacilitiesItem) {
        contractFacilitiesItem.setUpdateTime(DateUtils.getNowDate());
        return contractFacilitiesItemMapper.updateContractFacilitiesItem(contractFacilitiesItem);
    }

    /**
     * 批量删除租客合同房屋设施价格
     * 
     * @param facilitiesItemIds 需要删除的租客合同房屋设施价格主键
     * @return 结果
     */
    @Override
    public int deleteContractFacilitiesItemByFacilitiesItemIds(Long[] facilitiesItemIds) {
        return contractFacilitiesItemMapper.deleteContractFacilitiesItemByFacilitiesItemIds(facilitiesItemIds);
    }

    /**
     * 删除租客合同房屋设施价格信息
     * 
     * @param facilitiesItemId 租客合同房屋设施价格主键
     * @return 结果
     */
    @Override
    public int deleteContractFacilitiesItemByFacilitiesItemId(Long facilitiesItemId) {
        return contractFacilitiesItemMapper.deleteContractFacilitiesItemByFacilitiesItemId(facilitiesItemId);
    }

    @Override
    public int insertBatchFacilitiesItem(List<ContractFacilitiesItem> contractFacilitiesItemList) {
        return contractFacilitiesItemMapper.insertBatchFacilitiesItem(contractFacilitiesItemList);
    }

    @Override
    public List<ContractFacilitiesItem> selectContractFacilitiesItemByContractId(String lesseeContractId) {
        return contractFacilitiesItemMapper.selectContractFacilitiesItemByContractId(lesseeContractId);
    }
}
